{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "wooden-fisher",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/goat-latin\n",
    "\n",
    "\n",
    "Runtime: 28 ms, faster than 83.46% of Python3 online submissions for Goat Latin.\n",
    "Memory Usage: 14.4 MB, less than 17.43% of Python3 online submissions for Goat Latin.\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def toGoatLatin(self, S: str) -> str:\n",
    "        #2:47\n",
    "        vowel = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n",
    "        words = S.split(\" \")\n",
    "        new_words = []\n",
    "        for index, word in enumerate(words, start=1):\n",
    "            first_char = word[0]\n",
    "            if first_char.lower() in vowel:\n",
    "                word = word + \"ma\"\n",
    "            else:\n",
    "                word = word[1:] + word[0] + \"ma\"\n",
    "            new_words.append(word+index*\"a\")\n",
    "        return \" \".join(new_words)\n",
    "        #2:52\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "electric-matthew",
   "metadata": {},
   "outputs": [],
   "source": [
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
